import request from '@/utils/request'

// 查询生产计划详情列表
export function listPlanDetail(query) {
  return request({
    url: '/produce/planDetail/list',
    method: 'get',
    params: query
  })
}

// 查询生产计划详情详细
export function getPlanDetail(id) {
  return request({
    url: '/produce/planDetail/' + id,
    method: 'get'
  })
}

// 查询生产计划详情详细
export function getPlanCountDetail(id) {
  return request({
    url: '/produce/planDetail/count/' + id,
    method: 'get'
  })
}

// 新增生产计划详情
export function addPlanDetail(data) {
  return request({
    url: '/produce/planDetail',
    method: 'post',
    data: data
  })
}

// 修改生产计划详情
export function updatePlanDetail(data) {
  return request({
    url: '/produce/planDetail',
    method: 'put',
    data: data
  })
}

// 删除生产计划详情
export function delPlanDetail(id) {
  return request({
    url: '/produce/planDetail/' + id,
    method: 'delete'
  })
}

// 分配日计划
export function fpPlanDay(data) {
  return request({
    url: '/produce/planDetail/fp',
    method: 'post',
    data: data
  })
}


// 余量分配
export function YLFP(data) {
  return request({
    url: '/produce/planDetail/ylfp',
    method: 'post',
    data: data
  })
}


// 余量分配
export function PXTB(data) {
  return request({
    url: '/produce/planDetail/pxtb',
    method: 'post',
    data: data
  })
}

// 班组列表
export function getTeamGroupSelect() {
  return request({
    url: '/basic/groupManagement/listSelect',
    method: 'get'
  })
}

// 工厂下拉列表
export function getFactoryList() {
  return request({
    url: '/basic/factory/selectList',
    method: 'get'
  })
}
